/*
 *    Copyright (c) 2018-2025, nart All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: nart
 */

package com.nai365.nart.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.nai365.nart.common.core.util.R;
import com.nai365.nart.product.entity.SkuInfo;

import java.util.List;

/**
 * sku信息
 *
 * @author baogs
 * @date 2022-07-01 11:05:45
 */
public interface SkuInfoService extends IService<SkuInfo> {

	R up(List<Long> skuIds,String price);

	boolean down(Long skuId);

	/**
	 * 查询我的Sku
	 * @param spuId spuId
	 * @param status 状态
	 * @return List<SkuInfo
	 */
	List<SkuInfo> findMySkuBySpuIdAndStatus(Long spuId,Integer status);

	/**
	 * 锁定一个可用的sku
	 *
	 * @param spuId spu id
	 * @return SkuInfo
	 */
	SkuInfo lockSkuInfo(Long spuId) throws Exception;

	SkuInfo unLockSkuInfo(SkuInfo skuInfo);

    SkuInfo findSkuInfoBySkuId(Long skuId);
}

